<template>
  <div class="trad">
    <div class="trad_left" v-if="leftShow">
      <div class="trad_top_title">
        <div class="title_left">
          <div class="title_left_top">
            <div class="title_item" v-for="(item, index) in titleList" :key="index" @click="handleChange(index)">
              <P class="title_name">{{ t(item) }}</P>
              <p class="underline" :class="{ active: activeIndex === index }"></p>
            </div>
          </div>
          <div class="stock_content">
            <div class="stock_list">
              <div class="stock_item" v-for="(item, index) in stockArray" :key="index" v-if="activeIndex == 0"
                @click="handleGetItem(item.id, item.symbol)">
                <div class="item_top">
                  <div class="item_top_left">
                    <img :src="url + item.logo" alt="" class="img_logo" />
                    <p class="name">{{ item.symbol }}</p>
                    <span class="type">US</span>
                  </div>
                  <p class="top_right" :style="
                    isPositive(item.price_change)
                      ? 'color:rgb(25, 202, 124)'
                      : 'color:rgb(254, 85, 79)'
                  ">
                    {{
                      isPositive(item.price_change)
                      ? "+" + item.price_change
                      : item.price_change
                    }}%
                  </p>
                </div>
                <div class="item_bottom">
                  <p class="price">${{ item.price }}</p>
                  <p class="name">${{ item.symbol }}</p>
                </div>
              </div>
              <div class="stock_list" v-else>
                <div class="stock_title">
                  <p class="name">{{ $t('trade.StockName') }}</p>
                  <p class="price">{{ $t('trade.Price') }}</p>
                  <p class="num">{{ $t('trade.ChangePercent') }}</p>
                  <!-- <p class="num"></p> -->
                </div>
                <div class="list">
                  <div class="stock_item" v-for="(item, index) in leftSymbols" :key="index"
                    @click="handleGetItem(item.stock_id, item.symbol)">
                    <div class="left">
                      <div class="info_top">
                        <p class="name">{{ item.symbol }}</p>
                        <p class="type">US</p>
                      </div>
                      <p class="desc">{{ item.name }}</p>
                    </div>
                    <p class="price">{{ item.price }}</p>
                    <p class="num" :style="
                      isPositive(item.price_change_pct)
                        ? 'color:rgb(25, 202, 124)'
                        : 'color: rgb(254, 85, 79)'
                    ">
                      {{
                        isPositive(item.price_change_pct)
                        ? "+" + item.price_change_pct
                        : item.price_change_pct
                      }}%
                    </p>
                    <i class="iconfont icon-shanchu" @click="removeItem(item)"></i>
                  </div>
                  <div class="add_stock" @click="handleSearch">
                    <i class="iconfont icon-plus-circle"></i>
                    <span class="add_text">{{ $t('trade.Watchlist') }}</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <i class="iconfont icon-sousuo" @click="handleSearch"></i>
      </div>
    </div>
    <div class="trad_content">
      <div class="content_top">
        <div class="top_title">
          <div class="top_Left">
            <i class="iconfont" @click="handleCloseLeft" :class="leftShow ? 'icon-zuojiantou-' : 'icon-youjiantou-'"></i>
            <p class="title_name">{{ stockItemInfo.name }}</p>
            <p class="title_type">{{ stockItemInfo.symbol }}</p>
          </div>
          <i class="iconfont" @click="handleCloseRight" :class="rightShow ? 'icon-youjiantou-' : 'icon-zuojiantou-'"></i>
        </div>
        <klinecharts @message="handleMessage" :klineName="klineName" ref="klineContent" />
      </div>
      <div class="content_bottom">
        <div class="title">
          <div class="title_left">
            <div class="title_item" v-for="(item, index) in holdingTitleList" :key="index"
              @click="selectHoldingIndex(index, item.symbol)">
              <p>{{ item }}</p>
              <p class="underline" :class="holdingIndex == index ? 'active' : ''"></p>
            </div>
          </div>
          <i class="iconfont icon-xiajiantou-"></i>
        </div>
        <div class="order_list" ref="holdingContent" @scroll="handleScroll">
          <div class="order_item" v-for="(item, index) in holdingList" :key="index">
            <div class="item_top" @click="handleCreateLine(item.symbol)">
              <div class="top_left">
                <p class="order_type" :style="
                  item.buy_direction == 'long'
                    ? 'color:rgb(39, 199, 126);border:1px solid rgb(39, 199, 126)'
                    : 'color:rgb(254, 85, 79);border:1px solid rgb(254, 85, 79)'
                ">
                  {{ item.buy_direction == "long" ? t('trade.marir') : t('trade.maic') }}
                </p>
                <p class="stock_name">{{ item.symbol }}</p>
                <p class="num">{{ item.buy_quantity }}lot</p>
                <p class="stock_num">x{{ item.leverage }}</p>
              </div>
              <div class="top_right">
                <!-- <p class="time">開倉時間:{{timestampToFormat(item.buytime)}}</p> -->
                <div class="btn1" @click="handlePopup(item)">{{ $t('trade.zhiying') }}{{ $t('trade.zhiying') }}</div>
                <div class="btn2" @click="handleConfim(item)">
                  <i class="iconfont icon-__guanbi"></i>{{ $t('trade.pingcang') }}
                </div>
              </div>
            </div>
            <div class="item_list">
              <div class="item_text">
                <p class="title_name name1">{{ $t('trade.kaicangjia') }}</p>
                <span class="title_num name1">{{ item.buy_price }}</span>
              </div>
              <div class="item_text">
                <p class="title_name">{{ $t('trade.dangqianjia') }}</p>
                <span class="title_num">--</span>
              </div>
              <div class="item_text">
                <p class="title_name">{{ $t('trade.zhiuingjia') }}</p>
                <span class="title_num">{{ item.target_profit_price }}</span>
              </div>
              <div class="item_text">
                <p class="title_name">{{ $t('trade.zhisunjia') }}</p>
                <span class="title_num">{{ item.stop_loss_price }}</span>
              </div>
              <div class="item_text">
                <p class="title_name">{{ $t('trade.chidangshou') }}</p>
                <span class="title_num">{{ item.dividend_price }}%</span>
              </div>
              <div class="item_text">
                <p class="title_name name2">{{ $t('trade.dangqianzhishou') }}</p>
                <span class="title_num name2">0</span>
              </div>
            </div>
          </div>
          <loadbottom :class="
            holdingPage == 1 && listLength == 0 && loadingType == 'noMore'
              ? 'bottom_loading'
              : ''
          " :page="holdingPage" :listLenght="listLength" :loadingType="loadingType" />
        </div>
      </div>
    </div>
    <div class="trad_right" v-if="rightShow">
      <div class="trad_info_top">
        <div class="trad_name">
          <p class="name">{{ stockItemInfo.symbol }}</p>
          <i class="iconfont icon-xihuan1"></i>
        </div>
        <div class="num_text">
          <p class="num">{{ stockItemInfo.price }}</p>
          <div class="num_list">
            <div class="num_item">
              <!-- 涨跌数 -->
              <div class="item_left">
                <i class="iconfont icon-xiajiang"></i>
                <span class="num_text1">{{ stockItemInfo.price_change }}</span>
              </div>
              <!-- 涨跌百分比 -->
              <p class="num_text1">{{ stockItemInfo.price_change_pct }}%</p>
              <p class="num_type">{{ $t('trade.panqian') }}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="trad_list">
        <div class="title_list">
          <div class="title_item" v-for="(item, index) in stockTitle" :key="index" @click="changeStockTitle(index)">
            <p class="name">{{ t(item) }}</p>
            <p class="underline" :class="stockIndex == index ? 'active' : ''"></p>
          </div>
        </div>
        <div class="change_content" v-if="stockIndex == 0">
          <div class="content_list">
            <div class="list1">
              <div class="list_item">
                <p class="name">{{ $t('trade.jinkaijia') }}</p>
                <p class="value">{{ stockItemInfo.open_price }}</p>
              </div>
              <div class="list_item">
                <p class="name">{{ $t('trade.zuoshoujia') }}</p>
                <p class="value">{{ stockItemInfo.close_price }}</p>
              </div>
            </div>
            <div class="list1">
              <div class="list_item">
                <p class="name">{{ $t('trade.zuigaojia') }}</p>
                <p class="value">{{ stockItemInfo.high_price }}</p>
              </div>
              <div class="list_item">
                <p class="name">{{ $t('trade.zuidijia') }}</p>
                <p class="value">{{ stockItemInfo.low_price }}</p>
              </div>
            </div>
          </div>
          <div class="see_more" @click="handleMore">
            <p class="more_text">{{ $t('trade.gengduo') }}</p>
            <i class="iconfont icon-youjiantou"></i>
          </div>
          <div class="stock_info">
            <div class="info_list">
              <p class="name">{{ $t('trade.fangxiang') }}</p>
              <div class="list_right">
                <p class="btn1" @click="selectIndex(1)" :style="
                  buyIndex == 1
                    ? 'background-color: #27c77e;color: #fff;'
                    : 'background-color: #555;color:#ffffff99'
                ">
                  {{ $t('trade.marir') }}
                </p>
                <p class="btn2" @click="selectIndex(2)" :style="
                  buyIndex == 2
                    ? 'background-color: #f35956;color: #fff;'
                    : 'background-color: #555;color:#ffffff99'
                ">
                  {{ $t('trade.maic') }}
                </p>
              </div>
            </div>
            <div class="info_list">
              <p class="name">{{ $t('trade.leixing') }}</p>
              <div class="list_right type">
                <div class="type_text1" v-for="(item, index) in stockTypeList" :key="index"
                  @click="handleSelectType(index)">
                  <p>{{ t(item) }}</p>
                  <p class="underline" :class="stockTitleIndex == index ? 'active' : ''"></p>
                </div>
              </div>
            </div>
            <div class="info_list" v-if="stockTitleIndex == 1">
              <p class="name">{{ $t('trade.xianjia') }}</p>
              <div class="input_text">
                <input type="number" v-model="price_limit" />
              </div>
            </div>
            <div class="info_big_list">
              <div class="list_top">
                <p class="name">{{ $t('trade.jiancanggu') }}</p>
                <div class="top_right">
                  <div class="remove" @click="handleRemove" :style="removeDisable ? 'cursor: not-allowed;' : ''">
                    <i class="iconfont icon-jianhao"></i>
                  </div>
                  <input type="number" v-model="numCopies" />
                  <div class="add" @click="handleAddNum" :style="addDisable ? 'cursor: not-allowed;' : ''">
                    <i class="iconfont icon-jiahao"></i>
                  </div>
                </div>
              </div>
              <div class="list_bottom">
                <p v-for="(item, index) in leverageList" :key="index" @click="handleCalculate(item, index)"
                  :style="numberIndex == index ? 'color:#589cf8' : ''">
                  {{ t(item) }}
                </p>
              </div>
            </div>
            <div class="info_list">
              <p class="name">{{ $t('trade.gangganbei') }}</p>
              <div class="list_right">
                <p class="multiple" v-for="(item, index) in leverMultiple" :key="index" @click="handleLever(item, index)"
                  :style="leverIndex == index ? 'color:#589cf8' : ''">
                  x{{ item }}
                </p>
              </div>
            </div>
          </div>
          <div class="stock_info text_info">
            <div class="info_list">
              <p class="name">{{ $t('trade.baozhengjin') }}</p>
              <p class="list_right">
                {{ marginNumber ? marginNumber : stockItemInfo.price }}
              </p>
            </div>
            <div class="info_list">
              <p class="name">{{ $t('trade.shouxufei') }}</p>
              <p class="list_right">
                {{ handFee ? handFee : stock_trade_fee }}
              </p>
            </div>
            <div class="info_list">
              <p class="name">{{ $t('trade.yue') }}</p>
              <p class="list_right">{{ userInfo.available_amount }}</p>
            </div>
          </div>
          <div class="type_btn" @click="handleSellOrBuy" :style="
            buyIndex == 1
              ? 'background-color: #27c77e'
              : 'background-color: #f35956'
          ">
            {{ buyIndex == "1" ? t('trade.marir') : t('trade.maic') }}
          </div>
          <div class="dynamic_charts">
            <div class="title">
              <div class="title_item" v-for="(item, index) in echartsList" :key="index"
                @click="changeEchartsIndex(index)">
                <p class="name">{{ t(item) }}</p>
                <p class="underline" :class="echartsIndex == index ? 'active' : ''"></p>
              </div>
            </div>
            <div class="charts" v-if="echartsIndex == 0">
              <div class="charts_left">
                <p class="title">{{ $t('trade.marir') }}</p>
                <div class="left_list">
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 80%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 60%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 20%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 80%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 60%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 20%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 80%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 60%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 20%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 20%"></div>
                  </div>
                </div>
              </div>
              <div class="charts_left charts_right">
                <p class="title">{{ $t('trade.maic') }}</p>
                <div class="right_list">
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 80%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 60%"></div>
                  </div>
                  <div class="list_item">
                    <p class="left">103</p>
                    <p class="right">2.97</p>
                    <div class="Proportion" style="width: 30%"></div>
                  </div>
                </div>
              </div>
            </div>
            <div class="charts_line" ref="chart" style="width: 100%; height: 300px" v-if="echartsIndex == 1"></div>
          </div>
        </div>
        <div class="analyze" v-if="stockIndex == 1">
          <div class="tradingview_content">
            <TradingViewTechnicalAnalysis :symbol="stockItemInfo.symbol" interval="1h" color-theme="dark" />
          </div>
        </div>
        <div class="overview" v-if="stockIndex == 2">
          <div class="overview_text">
            <div class="text_list">
              <p class="name">{{ $t('trade.chanye') }}:</p>
              <span class="value">REAL ESTATE INVESTMENT TRUSTS</span>
            </div>
            <div class="text_list">
              <p class="name">{{ $t('trade.bumen') }}:</p>
              <span class="value">REAL ESTATE & CONSTRUCTION</span>
            </div>
          </div>
          <p class="info_text">
            Cherry Hill Mortgage Investment Corporation, a residential real
            estate financing company, acquires, invests, and manages residential
            mortgage assets in the United States. The company is headquartered
            in Farmingdale, New Jersey.
          </p>
        </div>
      </div>
    </div>
  </div>
  <!-- 订单列表框 -->
  <div v-if="showPopup1025" class="mask1025">
    <div class="popup-container1025">
      <!-- 头部 -->
      <div class="popup-header1025">
        <div class="header_content">
          <div class="header">
            <div class="top">
              <h3 class="title1025">{{ holdingItem.stock_name }}</h3>
              <p class="type">US</p>
            </div>
            <CloseBold class="close-icon1025" style="color: #fff" @click="handleClosePopup1025" />
          </div>
          <p class="type_text">{{ holdingItem.symbol }}</p>
        </div>
        <div class="content_list">
          <div class="list_item">
            <p class="name">{{ $t('trade.kaicangjia') }}</p>
            <span class="value">20.00</span>
          </div>
          <div class="list_item">
            <p class="name">{{ $t('trade.dangqianjia') }}</p>
            <span class="value">20</span>
          </div>
          <div class="list_item">
            <p class="name">{{ $t('trade.zhiuingjia') }}</p>
            <input type="number" class="input_text" v-model="holdingInfo.target_profit_price" />
          </div>
          <div class="list_item">
            <p class="name">{{ $t('trade.zhisunjia') }}</p>
            <input type="number" class="input_text" v-model="holdingInfo.stop_loss_price" />
          </div>
        </div>
        <div class="content_info">
          <div class="info_item">
            <p class="name">{{ $t('trade.mairugu') }}</p>
            <span class="value">{{ holdingItem.buy_quantity }}</span>
          </div>
          <div class="info_item">
            <p class="name">{{ $t('trade.gangganbei') }}</p>
            <span class="value">x{{ holdingItem.leverage }}</span>
          </div>
          <div class="info_item">
            <p class="name">{{ $t('trade.chidangshou') }}</p>
            <span class="value">0.00%</span>
          </div>
          <div class="info_item">
            <p class="name">{{ $t('trade.dangqianzhishou') }}</p>
            <span class="value">0.00</span>
          </div>
          <div class="info_item">
            <p class="name">{{ $t('trade.kaicangshi') }}</p>
            <span class="value">2020/06/04 10:22:18</span>
          </div>
        </div>
        <button class="confirm" @click="handleSetHoldingOrder">{{ $t('trade.queren') }}</button>
      </div>
    </div>
  </div>
  <!-- 确定框 -->
  <div v-if="showPopup1026" class="mask1025" @click.self="showPopup1026 = false">
    <div class="popup-container1025 confirm_box">
      <p class="title">{{ $t('trade.tishi') }}</p>
      <p class="content_text">{{ $t('trade.quedingpingma') }}</p>
      <div class="bottom_btn">
        <p @click="showPopup1026 = false">{{ $t('trade.qvxiao') }}</p>
        <p class="confirm_text1" @click="handleSell">{{ $t('trade.queren') }}</p>
      </div>
    </div>
  </div>
  <div v-if="showPopup1027" class="mask1025">
    <div class="popup-container1025 search_content">
      <div class="header">
        <p class="title">{{ $t('trade.sousuo') }}</p>
        <CloseBold class="close-icon1025" style="color: #fff" @click="handleClosePopup1027" />
      </div>
      <div class="search_content">
        <div class="search_input">
          <i class="iconfont icon-sousuo"></i>
          <input type="text" class="input_text" @input="handleInputSearch" v-model="searchInput" />
        </div>
        <div class="search_list">
          <div class="list_item" v-for="(item, index) in searchList" :key="index" v-if="searchList.length">
            <div class="item_left">
              <div class="text_top">
                <p class="name">{{ item.symbol }}</p>
                <p class="type">US</p>
              </div>
              <p class="text_desc">{{ item.name }}</p>
            </div>
            <div class="item_right">
              <p class="like_num">{{ item.price }}</p>
              <i class="iconfont" @click="handelAddSymbol(item)" :style="item.is_follow ? 'color:#fd5755;' : ''"
                :class="item.is_follow ? 'icon-xihuan' : 'icon-xihuan1'"></i>
            </div>
          </div>
          <div class="noData" v-else>
            <i class="iconfont icon-meiyougengduo"></i>
            <span class="noData_text">{{ $t('trade.meiyougeng') }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 买入卖出 -->
  <div v-if="showPopup1028" class="mask1025" @click.self="showPopup1028 = false">
    <div class="popup-container1025 buyOrsell">
      <p class="title">{{ $t('trade.tishi') }}</p>
      <div class="list_text">
        <div class="text_item">
          <p class="name">{{ $t('trade.gupiaom') }}</p>
          <p class="value">{{ stockItemInfo.symbol }}</p>
        </div>
        <div class="text_item">
          <p class="name">{{ $t('trade.fangxiang') }}</p>
          <p class="value">{{ buyIndex == "1" ? t('trade.marir') : t('trade.maic') }}</p>
        </div>
        <div class="text_item">
          <p class="name">{{ $t('trade.jiancanggu') }}</p>
          <p class="value">{{ numCopies }}</p>
        </div>
        <div class="text_item">
          <p class="name">{{ $t('trade.gangganbei') }}</p>
          <p class="value">{{ numberLever }}</p>
        </div>
        <div class="text_item">
          <p class="name">{{ $t('trade.baozhengjin') }}</p>
          <p class="value">
            {{ marginNumber ? marginNumber : stockItemInfo.price }}
          </p>
        </div>
        <div class="text_item">
          <p class="name">{{ $t('trade.shouxufei') }}</p>
          <p class="value">{{ handFee ? handFee : stock_trade_fee }}</p>
        </div>
      </div>
      <div class="btn_list">
        <button class="btn1" @click="showPopup1028 = false">{{ $t('trade.qvxiao') }}</button>
        <button class="btn2" @click="handleConfimStock" :style="
          buyIndex == '1'
            ? 'border: 1px solid #27c77e;background-color: #27c77e;'
            : 'border: 1px solid #f35956;background-color: #f35956;'
        ">
          {{ $t('trade.queren') }}
        </button>
      </div>
    </div>
  </div>
  <!-- 抽屉 -->
  <el-drawer v-model="dialog" direction="rtl" class="demo-drawer" size="20%" :show-close="false" :with-header="false">
    <div class="content" style="width: 100%; height: 100%">
      <div class="header">
        <i class="iconfont icon-zuojiantou-1" @click="closeDrawer"></i>
        <span class="title_name">{{ $t('trade.jibenmian') }}</span>
      </div>
      <div class="content_list">
        <div class="list_item">
          <p class="key">{{ $t('trade.zuigaojia') }}</p>
          <span class="value">{{ stockItemInfo.high_price }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.jinkaijia') }}</p>
          <span class="value">{{ stockItemInfo.open_price }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.chengjiaol') }}</p>
          <span class="value">{{ stockItemInfo.volume }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.zuidijia') }}</p>
          <span class="value">{{ stockItemInfo.low_price }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.zuoshoujia') }}</p>
          <span class="value">{{ stockItemInfo.close_price }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.zongshizhi') }}</p>
          <span class="value">{{ stockItemInfo.market_cap }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.shizhichengz') }}</p>
          <span class="value">--</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.shiyingl') }}</p>
          <span class="value">{{ stockItemInfo.pe_ratio }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.zongguben') }}</p>
          <span class="value">--</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.52zhougao') }}</p>
          <span class="value">3.68</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.shijingl') }}</p>
          <span class="value">0.853</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.shixiaol') }}</p>
          <span class="value">4.558</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.52zhoudi') }}</p>
          <span class="value">2.364</span>
        </div>
        <div class="list_item">
          <p class="key">ROA</p>
          <span class="value">-2.23%</span>
        </div>
        <div class="list_item">
          <p class="key">ROE</p>
          <span class="value">-13.40%</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.meigus') }}</p>
          <span class="value">{{ stockItemInfo.eps }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.meiguxi') }}</p>
          <span class="value">{{ stockItemInfo.dividend_price }}</span>
        </div>
        <div class="list_item">
          <p class="key">{{ $t('trade.guxilv') }}</p>
          <span class="value">17.00%</span>
        </div>
      </div>
    </div>
  </el-drawer>
</template>

<script setup>
import { init } from "klinecharts";
import { useI18n } from "vue-i18n"; // 从 vue-i18n 导入 useI18n
import { ref, onMounted, onUnmounted, computed, nextTick, watch } from "vue";
import klinecharts from "../../components/klinecharts.vue";
import {
  holdingOrder,
  symbolsList,
  stockList1,
  searchSymbols,
  addSymbols,
  delSymbols,
  stockItem,
  setholdingOrder,
  setSell,
  createHoldingOrder,
} from "../../api/stock.js";
import { getStock1 } from "../../api/fund.js";
import { isPositive, url } from "../../utils/util.js";
import { throttle } from "lodash";
import loadbottom from "../../components/loadbottom.vue";
// 引入tradingview组件库
import TradingViewTechnicalAnalysis from "../../components/TradingViewTechnicalAnalysis.vue";

const chartDom = ref(null);
const chartInstance = ref(null);
// 指标列表
// const newIndicator = ref([])
// "VOL", "MACD", "RSI", "KDJ", "OBV", "WR"
const indicators = ref([
  {
    name: "VOL",
    select: false,
  },
  {
    name: "MACD",
    select: false,
  },
  {
    name: "RSI",
    select: false,
  },
  {
    name: "KDJ",
    select: false,
  },
  {
    name: "OBV",
    select: false,
  },
  {
    name: "WR",
    select: false,
  },
]);
const indicatorsIndex = ref(0);
const minuteList = ["5m", "15m", "30m", "1D", "1W", "1M"];
// const containerRef = ref(null);
// const resizeObserver = ref(null);
const { t, locale } = useI18n();

const titleList = ref(["trade.gupiao", "trade.zixuan"]);
const echartsList = ref(["trade.weituogua", "trade.shendutu"]);
const stockTitle = ref(["trade.gaikuang", "trade.fenxi", "trade.jiankuang"]);
const leverageList = ref(["trade.quancang1", "trade.quancang2", "trade.quancang3", "trade.quancang4"]);

const activeIndex = ref(0);
const activeTimeFrame = ref("1D");
const echartsIndex = ref(0);
const showPopup1025 = ref(false);
const showPopup1026 = ref(false);
const showPopup1027 = ref(false);
const showPopup1028 = ref(false);
const dialog = ref(false);
const lineEchart = ref(null);



const animationDuration = ref(1500);

const stockIndex = ref(0);
const data = ref([7, 8, 9, 10, 11]);
const zhi = ref([0, 0, 0.05, 0.15]);
const zhi1 = ref([0.03, 0.05, 0.15, 0.2, 0.2, 0.45, 0.05, 0.03, 0]);
const gaugeCharts = ref(null);
const buyIndex = ref(1);
const seeMore = ref(false);
const stockData = ref(null);

const indicatorsMap = new Map();

const SpeedGauge = () => {
  nextTick().then(() => { });
};

const handleMore = () => {
  dialog.value = true;
};
const handleSearch = () => {
  showPopup1027.value = true;
};
const handleSellOrBuy = () => {
  showPopup1028.value = true;
};
const changeEchartsIndex = (index) => {
  echartsIndex.value = index;
  if (index == 1) {
    // 仪表盘数据
  }
};

const chart = ref(null);
// 持仓数据
const holdingPage = ref(1);
const listLength = ref(0);
const loadingType = ref("loading");
const holdingTitleList = ref(["holding", "pending", "other"]);
const holdingIndex = ref(0);
const holdingList = ref([]);

// 搜索股票数据
const searchInput = ref("");
const searchList = ref([]);
// 获取单个股票数据
const stockItemInfo = ref({});
const userInfo = ref({});
// Kline的股票名称
const klineName = ref("");
const klineContent = ref(null);
// const myChart = ref(null)
onMounted(() => {
  userInfo.value = JSON.parse(localStorage.getItem("userInfo"));
  console.log("获取用户信息-----", userInfo.value);
  getStock();
  getConfigFee();
  getStockList();
  // getSymbolsList();
  getHoldingOrder();

  // initChart();
  // setupResizeObserver();
});

const leverMultiple = ref([]);
const numberIndex = ref(null);
const leverIndex = ref(0);
const numberLever = ref(1);
const numCopies = ref("1");
const removeDisable = ref(false);
const addDisable = ref(false);
const stockTypeList = ref(["trade.shijia", "trade.xianjia"]);
const stockTitleIndex = ref(0);
const percentage = ref(null);
// 输入的限股金额
const price_limit = ref(null);
// 手续费
const handFee = ref(null);
// 限股时的保证金
const marginNumber = ref(null);
// 股票买入卖出的手续费
const stock_trade_fee = ref(0);
const selectStockId = ref(null);
// 获取杠杆倍数
const getStock = async () => {
  const res = await getStock1("lever");
  if (res.code == 200) {
    leverMultiple.value = res.data.value.leverage_multiples;
  }
};
// 获取股票手续费
const getConfigFee = async () => {
  const res = await getStock1("stock");
  if (res.code == 200) {
    stock_trade_fee.value = res.data.value.stock_trade_fee;
  }
};

const handleLever = (item, index) => {
  leverIndex.value = index;
  numberLever.value = Number(item);
  numCopies.value = parseInt(numCopies.value * Number(item));
  // 保证金
  // marginNumber.value =
  //   (Number(stockItemInfo.value.price) * Number(numCopies.value)) /
  //   numberLever.value;

  if (stockTitleIndex.value == 0) {
    // 保证金
    marginNumber.value =
      (Number(price_limit.value) * results(percentage.value)) /
      numberLever.value;

    handFee.value =
      Number(stockItemInfo.value.price) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  } else if (stockTitleIndex.value == 1) {
    // 当前为限价
    marginNumber.value =
      (Number(price_limit.value) * Number(numCopies.value)) / numberLever.value;
    handFee.value =
      Number(price_limit.value) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  }
  console.log("点击倍数----", price_limit.value);
};

// 点击几分之几
const handleCalculate = (item, index) => {
  numberIndex.value = index;
  percentage.value = item;

  // 选择张数时将下面的倍数值清空
  if (index == 3) {
    numCopies.value = parseInt(
      Number(userInfo.value.available_amount) /
      Number(stockItemInfo.value.price)
    );
  } else {
    numCopies.value = parseInt(
      (Number(userInfo.value.available_amount) /
        Number(stockItemInfo.value.price)) *
      results(item) *
      numberLever.value
    );
  }

  if (stockTitleIndex.value == 0) {
    // 保证金
    marginNumber.value =
      (Number(price_limit.value) * results(percentage.value)) /
      numberLever.value;

    handFee.value =
      Number(stockItemInfo.value.price) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  } else if (stockTitleIndex.value == 1) {
    // 当前为限价
    marginNumber.value =
      (Number(price_limit.value) * Number(numCopies.value)) / numberLever.value;
    handFee.value =
      Number(price_limit.value) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  }
};
const results = (fraction) => {
  const [num, den] = fraction.split("/").map(Number);
  return num / den;
};
const handleRemove = () => {
  if (!removeDisable.value) {
    numCopies.value--;
  }
};
const handleAddNum = () => {
  if (!addDisable.value) {
    numCopies.value++;
  }
};
watch(numCopies, (newValue, oldValue) => {
  if (newValue <= 1) {
    //  等于最小值时不可再减
    removeDisable.value = true;
  } else {
    removeDisable.value = false;
  }
  if (stockTitleIndex.value == 0) {
    // 当前为市价
    // 保证金
    marginNumber.value =
      (Number(stockItemInfo.value.price) * Number(numCopies.value)) /
      numberLever.value;

    handFee.value =
      Number(stockItemInfo.value.price) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  } else if (stockTitleIndex.value == 1) {
    // 当前为限价
    marginNumber.value =
      (Number(price_limit.value) * Number(numCopies.value)) / numberLever.value;
    handFee.value =
      Number(price_limit.value) *
      Number(numCopies.value) *
      Number(stock_trade_fee.value);
  }

  console.log("值变化了要改变了----", price_limit.value);
  // 最大不得超过5倍杠杆倍数
  // if (newValue >= rightOtcInfo.value.max_subscribe_quantity) {
  //   //  等于最大值时不可再加
  //   addDisable.value = true;
  // } else {
  //   addDisable.value = false;
  // }
});
// 保证金
// const marginNumber = computed(() => {
//   if (percentage.value) {
//     return (
//       (Number(stockItemInfo.value.price) * Number(numCopies.value)) /
//       numberLever.value
//     );
//   }
// });
// 手续费
// const handFee = computed(() => {
//   if (percentage.value) {
//     return (
//       Number(stockItemInfo.value.price) *
//       results(percentage.value) *
//       Number(stock_trade_fee.value)
//     );
//   }
// });
// 监听输入的限额
watch(price_limit, (newValue, oldValue) => {
  // 根据输入的限额计算保证金以及手续费
  marginNumber.value =
    (Number(newValue) * Number(numCopies.value)) / numberLever.value;
  handFee.value =
    Number(newValue) * Number(numCopies.value) * Number(stock_trade_fee.value);
});

const handleSelectType = (index) => {
  stockTitleIndex.value = index;
  // 将数据初始化
  // 建倉股數
  numCopies.value = 1;
  // 建倉股數下标
  numberIndex.value = null;
  // 槓桿倍數值
  numberLever.value = 1;
  // 槓桿倍數下标
  leverIndex.value = 0;
  //  保证金
  marginNumber.value = null;
  // 手续费为默认值
  handFee.value = stock_trade_fee.value;
  console.log("数据-----", handFee.value);
};
const handleConfimStock = async () => {
  // buyIndex == "1" ? "買入" : "賣出"
  const data = {
    buy_direction: buyIndex.value == "1" ? "short" : "long",
    // market-市价，limit-限价
    buy_type: stockTitleIndex.value == 0 ? "market" : "limit",
    buy_quantity: numCopies.value, //price_limit
    buy_price: price_limit.value,
    leverage: numberLever.value,
    symbol: stockItemInfo.value.symbol,
  };
  console.log("传递的数据-----", data, price_limit.value);
  const res = await createHoldingOrder(data);
  if (res.code == 200) {
    console.log("数据返回----", res);
    ElMessage.success({
      message: res.message,
      type: "success",
      plain: true,
    });
    getStockItem();
    // 数据初始化
    // 建倉股數
    numCopies.value = 1;
    // 建倉股數下标
    numberIndex.value = null;
    // 槓桿倍數值
    numberLever.value = 1;
    // 槓桿倍數下标
    leverIndex.value = 0;
    //  保证金
    marginNumber.value = null;
    // 手续费为默认值
    handFee.value = stock_trade_fee.value;
    showPopup1028.value = false;
  }
};

const holdingContent = ref(null);
const handleScroll = () => {
  console.log("数据滚动");
  if (listLength.value == 10) {
    holdingPage.value++;
    getHoldingOrder();
  }
};

// 设置止盈止损
const holdingInfo = ref({});
const holdingItem = ref({});
const handleSetHoldingOrder = async () => {
  const data = {
    ...holdingInfo.value,
  };
  const res = await setholdingOrder(holdingItem.value.id, data);
  if (res.code == 200) {
    ElMessage.success({
      message: res.message,
      type: "success",
      plain: true,
    });

    getHoldingOrder();
  }
};
const handleClosePopup1025 = () => {
  showPopup1025.value = false;
  holdingPage.value = 1;
  holdingInfo.value.target_profit_price = "";
  holdingInfo.value.stop_loss_price = "";
};
const handlePopup = (item) => {
  showPopup1025.value = true;
  holdingItem.value = item;
};
const handleConfim = (item) => {
  showPopup1026.value = true;
  holdingItem.value = item;
};
const handleSell = async () => {
  const res = await setSell(holdingItem.value.id);
  if (res.code == 200) {
    showPopup1026.value = false;
    ElMessage.success({
      message: res.message,
      type: "success",
      plain: true,
    });
    getHoldingOrder();
  }
};

// 中间内容的左右按钮
const leftShow = ref(true);
const rightShow = ref(true);
const handleCloseLeft = () => {
  leftShow.value = !leftShow.value;
  setupResizeObserver();
};
const handleCloseRight = () => {
  rightShow.value = !rightShow.value;
  setupResizeObserver();
};
const handleGetItem = (id, symbol) => {
  selectStockId.value = id;
  klineName.value = symbol;
  // console.log("trade-----",klineName.value)
  klineContent.value.getKline(symbol);
  getStockItem();
};
const handleCreateLine = (symbol) => {
  klineName.value = symbol;
  klineContent.value.getKline(symbol);
}
const getStockItem = async () => {
  const res = await stockItem(selectStockId.value);
  if (res.code == 200) {
    stockItemInfo.value = res.data;
    price_limit.value = JSON.parse(JSON.stringify(res.data.price));
  }
};
const removeItem = async (item) => {
  handleDelSymbols(item);
};
const handleClosePopup1027 = () => {
  showPopup1027.value = false;
  searchList.value = [];
  searchInput.value = "";
};

// 删除自选股票
const handleDelSymbols = async (item) => {
  console.log("这里获取name-----", name);
  const res = await delSymbols(item.symbol);
  if (res.code == 200) {
    item.is_follow = false;
    getSymbolsList();
    console.log("移除成功----", res.data);
  }
};
const handelAddSymbol = async (item) => {
  if (!item.is_follow) {
    const data = {
      symbol: item.symbol,
    };
    const res = await addSymbols(data);
    if (res.code == 200) {
      // ElMessage.success({
      //   message: res.message,
      //   type: "success",
      //   plain: true,
      // });
      item.is_follow = true;
      // 添加成功
      getSymbolsList();
    }
  } else {
    // const name = item.symbol.split(" ").join("");
    handleDelSymbols(item);
  }
};

//接受K线组件ws消息当前价格
const handleMessage = (msg) => {
  console.log('父组件收到消息:', msg);
  if (msg) {
    stockItemInfo.value.price = msg
  }
  // 这里可以 push 到父组件的数组，或做别的处理
};



const handleInputSearch = throttle(async () => {
  // console.log("搜索了-----",searchInput.value)
  const res = await searchSymbols(searchInput.value);
  if (res.code == 200) {
    searchList.value = res.data;
  } else if (res.code == 500) {
    //  当前为没查到数据
  }
}, 500);
const changeStockTitle = (index) => {
  stockIndex.value = index;
};

// 获取股票列表
const stockArray = ref([]);
const stockPage = ref(1);
const getStockList = async () => {
  const res = await stockList1();
  if (res.code == 200) {
    stockArray.value = res.data;
    // 获取股票详情
    selectStockId.value = res.data[0].id;
    klineName.value = res.data[0].symbol;
    klineContent.value.getKline(res.data[0].symbol);
    getStockItem();
  }
};

const leftSymbols = ref([]);
// 获取左侧的自选股票列表
const getSymbolsList = async () => {
  const data = {
    page: stockPage.value,
  };
  const res = await symbolsList(data);
  if (res.code == 200) {
    leftSymbols.value = res.data.data;
    console.log("自选数据-----", leftSymbols.value);
  }
};
const selectHoldingIndex = (index, symbol) => {
  holdingIndex.value = index;
  holdingPage.value = 1;
  listLength.value = 0;
  loadingType.value = "loading";
  klineName.value = symbol;
  getHoldingOrder();
};

// 获取持仓列表
const getHoldingOrder = async () => {
  const data = {
    page: holdingPage.value,
  };
  if (holdingIndex.value == 0) {
    data.status = "holding";
  } else if (holdingIndex.value == 1) {
    data.status = "pending";
  } else if (holdingIndex.value == 2) {
    data.status = "other";
  }
  const res = await holdingOrder(data);
  if (res.code == 200) {
    listLength.value = res.data.records ? res.data.records.length : 0;
    loadingType.value = "noMore";
    if (holdingPage.value == 1) {
      holdingList.value = res.data.records;
    } else {
      holdingList.value = holdingList.value.concat(res.data.records);
    }
  }
};

// 设置尺寸监听
const setupResizeObserver = () => {
  window.addEventListener("resize", () => {
    chartInstance.value.resize();
  });
};
const initChart = () => {
  if (chartDom.value) {
    // 正确初始化图表实例
    chartInstance.value = init(chartDom.value, {
      styles: {
        // 去除主K线图与指标区域之间的分割线
        separator: {
          color: "transparent", // 设置为透明
          size: 0, // 设置大小为0
        },
        // 去除指标区域之间的分割线
        indicator: {
          separator: {
            color: "transparent",
            size: 0,
          },
        },
        grid: {
          horizontal: {
            color: "#2a2e39",
            size: 1,
          },
          vertical: {
            color: "#2a2e39",
            size: 1,
          },
        },
        candle: {
          type: "area",
          area: {
            lineColor: "#3D7AEB",
            lineSize: 2,
            fillColor: "rgba(61, 122, 235, 0.2)",
          },
          priceMark: {
            high: { show: true },
            low: { show: true },
            last: { show: true },
          },
        },
        xAxis: {
          axisLine: {
            color: "#2a2e39",
          },
          tickLine: {
            color: "#2a2e39",
          },
          tickText: {
            color: "#7F7F7F",
          },
        },
        yAxis: {
          axisLine: {
            color: "#2a2e39",
          },
          tickLine: {
            color: "#2a2e39",
          },
          tickText: {
            color: "#7F7F7F",
          },
        },
      },
    });
    const data = generateSampleData();
    chartInstance.value.applyNewData(data);
    console.log("chartInstance.value=====", chartInstance.value);
  }
};
// 生成示例数据
const generateSampleData = () => {
  const data = [];
  let basePrice = 100;
  const now = new Date().getTime();

  for (let i = 0; i < 100; i++) {
    const open = basePrice + Math.random() * 10 - 5;
    const close = basePrice + Math.random() * 10 - 5;
    const high = Math.max(open, close) + Math.random() * 5;
    const low = Math.min(open, close) - Math.random() * 5;

    data.push({
      open,
      high,
      low,
      close,
      volume: Math.round(Math.random() * 1000) + 500,
      timestamp: now - (100 - i) * 60 * 60 * 1000,
    });

    basePrice = close;
  }

  return data;
};

const toggleIndicator = (indicator, index) => {
  // 检查指标是否已存在
  if (indicatorsMap.has(indicator)) {
    // 如果存在，移除该指标
    chartInstance.value.removeIndicator({ name: indicator });
    // 删除数组中指标的数据
    indicatorsMap.delete(indicator);
    // 样式去除
    indicators.value[index].select = false;
    return;
  } else {
    indicators.value[index].select = true;
  }

  // 定义指标高度配置
  const indicatorConfigs = {
    VOL: { heightRatio: 0.05, series: "volume" },
    MACD: { heightRatio: 0.15, series: "normal" },
    RSI: { heightRatio: 0.15, series: "normal" },
    KDJ: { heightRatio: 0.15, series: "normal" },
    OBV: { heightRatio: 0.15, series: "normal" },
    WR: { heightRatio: 0.15, series: "normal" }, // 新增WR指标配置
  };

  // 计算主图剩余高度 (1 - 所有指标高度总和)
  let totalIndicatorHeight = 0;
  indicatorsMap.forEach(() => {
    totalIndicatorHeight += 0.15; // 每个指标占15%
  });

  const mainHeightRatio = Math.max(0.4, 1 - totalIndicatorHeight - 0.15); // 主图最小保持40%

  // 创建新指标
  const config = indicatorConfigs[indicator];
  let newIndicator;

  switch (indicator) {
    case "VOL":
      newIndicator = chartInstance.value.createIndicator({
        name: "VOL",
        calcParams: [5, 10, 20],
        series: config.series,
        visible: true,
        height: 10,
        styles: {
          bar: {
            upColor: "#ef5350",
            downColor: "#26a69a",
          },
          line: {
            colors: ["#FF9800", "#2196F3", "#9C27B0"],
          },
        },
      });
      break;

    case "MACD":
      newIndicator = chartInstance.value.createIndicator({
        name: "MACD",
        calcParams: [12, 26, 9],
        series: config.series,
        visible: true,
        heightRatio: config.heightRatio,
        styles: {
          line: {
            colors: ["#FF9800", "#2196F3"],
          },
          bar: {
            upColor: "#ef5350",
            downColor: "#26a69a",
          },
        },
      });
      break;

    case "RSI":
      newIndicator = chartInstance.value.createIndicator({
        name: "RSI",
        calcParams: [6, 12, 24],
        series: config.series,
        visible: true,
        heightRatio: config.heightRatio,
        styles: {
          line: {
            colors: ["#FF9800", "#2196F3", "#9C27B0"],
          },
        },
      });
      break;

    case "KDJ":
      newIndicator = chartInstance.value.createIndicator({
        name: "KDJ",
        calcParams: [9, 3, 3],
        series: config.series,
        visible: true,
        heightRatio: config.heightRatio,
        styles: {
          line: {
            colors: ["#FF9800", "#2196F3", "#9C27B0"],
          },
        },
      });
      break;

    case "OBV":
      newIndicator = chartInstance.value.createIndicator({
        name: "OBV",
        calcParams: [30],
        series: config.series,
        visible: true,
        heightRatio: config.heightRatio,
        styles: {
          line: {
            colors: ["#FF9800", "#2196F3"],
          },
        },
      });
      break;

    case "WR":
      newIndicator = chartInstance.value.createIndicator({
        name: "WR",
        calcParams: [14], // 通常使用14周期
        series: config.series,
        visible: true,
        heightRatio: config.heightRatio,
        styles: {
          line: {
            colors: ["#FF9800"], // 橙色线条
            size: 1,
          },
          // 添加水平参考线 (超买超卖区域)
          levels: [
            { value: 20, color: "#FF0000" }, // 超卖线
            { value: 80, color: "#00FF00" }, // 超买线
          ],
        },
      });
      break;

    default:
      console.warn(`Unknown indicator: ${indicator}`);
      return;
  }
  console.log("zhibiaoshuju 000000", indicatorsMap);
  // 将新指标存入Map
  indicatorsMap.set(indicator, newIndicator);
};
const handleChange = (index) => {
  activeIndex.value = index;
  if (index == 0) {
    getStockList();
  } else if (index == 1) {
    getSymbolsList();
  }
};
const selectIndex = (index) => {
  buyIndex.value = index;
};
const closeDrawer = () => {
  dialog.value = false;
};
const handelMoreList = () => {
  seeMore.value = !seeMore.value;
};

// 组件卸载时移除滚动监听
onUnmounted(() => {
  // window.removeEventListener('scroll', handleScroll);
});
</script>
<!-- element的样式 -->
<style lang="less">
.demo-drawer {
  .el-drawer__body {
    padding: 0;
    background-color: rgb(32, 43, 44);
  }
}
</style>
<style scoped lang="less">
.content {
  width: 100%;
  height: 100%;
  padding: 0 15px;

  .header {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;

    .icon-zuojiantou-1 {
      font-size: 20px;
      color: rgb(255, 255, 255);
      cursor: pointer;
    }

    .title_name {
      color: rgb(255, 255, 255);
      font-size: 16px;
      line-height: 30px;
      padding-left: 15px;
    }
  }

  .content_list {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    .list_item:nth-child(3n + 2) {

      /* 匹配位置为2、5、8、11...的元素 */
      .key {
        text-align: center;
      }

      .value {
        text-align: center;
      }
    }

    .list_item:nth-child(3n) {

      /* 匹配位置为3、6、9、12...的元素 */
      .key {
        text-align: right;
      }

      .value {
        text-align: right;
      }
    }

    .list_item {
      width: 33%;
      display: flex;
      flex-direction: column;
      margin: 10px 0;

      .key {
        color: #fff;
        opacity: 0.5;
        font-size: 11px;
      }

      .value {
        color: #fff;
        opacity: 0.9;
        font-weight: 700;
        font-size: 15px;
        margin-top: 4px;
      }
    }
  }
}

.mask1025 {
  .popup-container1025 {
    width: 600px;
    height: 70%;
    padding: 15px;
    border-radius: 10px;
    overflow: hidden;
    overflow-y: auto;

    .header_content {
      width: 100%;
      padding-bottom: 10px;
      border-bottom: 1px solid #3c3e47;

      .header {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .top {
          display: flex;
          align-items: center;

          .title1025 {
            font-size: 15px;
            margin-right: 10px;
          }

          .type {
            background-color: rgba(0, 123, 255, 0.1);
            color: #007bff;
            border-radius: 3px;
            font-size: 10px;
            padding: 2px 5px;
            box-sizing: border-box;
            border: none;
            font-style: normal;
          }
        }
      }

      .type_text {
        color: #fff;
        font-size: 14px;
        opacity: 0.7;
      }
    }

    .content_list {
      padding-bottom: 15px;
      border-bottom: 1px solid #3c3e47;

      .list_item {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 15px;
        flex-direction: row;
        padding-top: 0px;

        .name {
          color: #fff;
          font-size: 14px;
        }

        .value {
          color: #fff;
          font-size: 14px;
          font-weight: 700;
        }

        .input_text {
          width: 40%;
          border-radius: 5px;
          border: 1px solid #3c3e47;
          text-align: right;
          padding: 3px 0;
          background-color: #202b2c;
          color: #fff;
          font-size: 14px;
          font-weight: 700;
          line-height: 22px;
        }
      }
    }

    .content_info {
      width: 100%;

      .info_item {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 15px;

        .name {
          color: #fff;
          font-size: 14px;
        }

        .value {
          color: #fff;
          font-size: 14px;
          font-weight: 700;
        }
      }
    }

    .confirm {
      width: 100%;
      line-height: 2.5;
      margin-top: 15px;
      font-size: 14px;
      background-color: #589cf8;
      color: #fff;
      border-radius: 5px;
      padding: 2px 0;
      border: none;
    }
  }

  .confirm_box {
    width: 300px;
    height: auto;
    padding: 0;
    border-radius: 3px;

    .title {
      width: 100%;
      text-align: center;
      padding: 15px 10px 5px;
      color: #fff;
      font-size: 18px;
    }

    .content_text {
      width: 100%;
      text-align: center;
      padding: 13px 16px 13px;
      min-height: 40px;
      font-size: 15px;
      line-height: 1.4;
    }

    .bottom_btn {
      width: 100%;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid #3c3e47;

      p {
        width: 50%;
        text-align: center;
        line-height: 48px;
        font-size: 15px;
        color: hsla(0, 0%, 100%, 0.7);
        cursor: pointer;
      }

      .confirm_text1 {
        color: #589cf8;
        border-left: 1px solid #3c3e47;
      }
    }
  }

  .search_content {
    width: 600px;
    border-radius: 10px;
    height: 60%;
    padding: 15px;

    .header {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;

      .title {
        height: 50px;
        color: #fff;
        font-size: 14px;
      }
    }

    .search_content {
      width: 100%;
      height: 100%;

      .search_input {
        width: 100%;
        border-radius: 20px;
        border: 1px solid #3c3e47;
        display: flex;
        align-items: center;
        padding: 0 15px;
        margin-bottom: 15px;
        background-color: #555;
        font-size: 14px;

        .icon-sousuo {
          font-size: 16px;
          color: #fff;
        }

        .input_text {
          flex: 1;
          height: 44px;
          padding: 0 15px;
          border-radius: 6px;
          font-size: 16px;
          margin-left: 5px;
          color: #fff;
        }
      }

      .search_list {
        width: 100%;
        height: calc(100% - 100px);
        overflow: hidden;
        overflow-y: auto;

        .list_item {
          width: 100%;
          display: flex;
          align-items: center;
          justify-content: space-between;
          border-radius: 10px;
          border: 1px solid #3c3e47;
          padding: 15px 10px;
          margin-bottom: 10px;

          .item_left {
            .text_top {
              display: flex;
              align-items: center;

              .name {
                color: #fff;
                font-size: 13px;
                overflow: hidden; //超出的隐藏
                text-overflow: ellipsis; //省略号
                white-space: nowrap;
              }

              .type {
                background-color: rgba(0, 123, 255, 0.1);
                color: #007bff;
                border-radius: 3px;
                font-size: 10px;
                padding: 2px 5px;
                box-sizing: border-box;
                border: none;
                font-style: normal;
                margin-left: 5px;
              }
            }

            .text_desc {
              color: #fff;
              opacity: 0.5;
              margin-top: 5px;
              font-size: 10px;
              overflow: hidden;
              text-overflow: ellipsis;
              display: -webkit-box;
              -webkit-box-orient: vertical;
              -webkit-line-clamp: 2;
            }
          }

          .item_right {
            display: flex;
            align-items: center;

            .like_num {
              color: #fff;
              font-size: 14px;
            }

            .iconfont {
              margin-left: 10px;
              color: #ffffff99;
              font-size: 20px;
            }
          }
        }

        .noData {
          width: 100%;
          height: calc(100% - 50px);
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;

          .iconfont {
            font-size: 100px;
            color: #fff;
            opacity: 0.7;
          }

          .noData_text {
            font-size: 14px;
            color: #fff;
            opacity: 0.7;
          }
        }
      }
    }
  }

  .buyOrsell {
    height: auto;

    .title {
      font-weight: 700;
      font-size: 15px;
      margin-bottom: 10px;
    }

    .list_text {
      width: 100%;

      .text_item {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;

        .name {
          color: hsla(0, 0%, 100%, 0.7);
          font-size: 14px;
        }

        .value {
          font-weight: 700;
          color: #fff;
          font-size: 14px;
        }
      }
    }

    .btn_list {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;

      button {
        width: 49%;
        text-align: center;
        cursor: pointer;
        line-height: 2.5;
        font-size: 14px;
        border-radius: 5px;
        padding: 2px 0;
      }

      .btn1 {
        border: 1px solid #3c3e47;
        background-color: hsla(0, 0%, 100%, 0.1);
        color: #b1b0b0;
      }

      .btn2 {
        border: 1px solid #f35956;
        background-color: #f35956;
        color: #fff;
      }
    }
  }
}

.trad {
  width: 100%;
  height: calc(100vh - 60px - 30px - 5px);
  background-color: #18191e;
  display: flex;

  .trad_left {
    width: 320px;
    height: 100%;
    background-color: #202b2c;
    border-radius: 5px;

    .trad_top_title {
      width: 100%;
      height: 50px;
      padding: 0 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;

      .title_left {
        flex: 1;
        height: 43px;

        .title_left_top {
          width: 100%;
          display: flex;
          align-items: center;
          line-height: 43px;
          font-size: 14px;

          .title_item {
            position: relative;
            margin-right: 20px;
            cursor: pointer;

            .title_name {
              color: rgba(255, 255, 255, 0.6);
            }

            .underline {
              position: absolute;
              bottom: 0;
              left: 50%;
              width: 20px;
              height: 3px;
              background-color: transparent;
              transition: background-color 0.3s;
              transform: translateX(-50%);
              border-radius: 8px;
            }

            .active {
              background-color: #f5bd08;
              /* 选中时下划线颜色 */
              border-radius: 8px;
            }
          }
        }

        .stock_content {
          width: 100%;

          .stock_list {
            width: 100%;
            height: calc(100vh - 160px);
            overflow-y: auto;

            .stock_title {
              width: 100%;
              display: flex;
              align-items: center;
              justify-content: space-between;
              color: #fff;
              opacity: 0.5;
              font-size: 12px;
              padding-top: 10px;
              cursor: pointer;

              .name {
                width: 50%;
                font-size: 12px;
              }

              .price {
                width: 25%;
                text-align: right;
                font-size: 12px;
              }

              .num {
                width: 25%;
                text-align: right;
                font-size: 12px;
              }
            }

            .add_stock {
              width: 100%;
              display: flex;
              align-items: center;
              justify-content: center;
              color: #fff;
              padding: 30px 0;

              .icon-plus-circle {
                font-size: 20px;
                cursor: pointer;
              }

              .add_text {
                cursor: pointer;
                padding-left: 5px;
                font-size: 13px;
              }
            }

            .stock_list {
              width: 100%;

              .stock_item {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                cursor: pointer;
                position: relative;

                .left {
                  width: 50%;

                  .info_top {
                    display: flex;
                    align-items: center;

                    .name {
                      font-weight: 700;
                      color: #fff;
                      font-size: 13px;
                    }

                    .type {
                      background-color: rgba(0, 123, 255, 0.1);
                      color: #007bff;
                      border-radius: 3px;
                      font-size: 10px;
                      padding: 2px 5px;
                      box-sizing: border-box;
                      border: none;
                      font-style: normal;
                      margin-left: 5px;
                    }
                  }

                  .desc {
                    color: #fff;
                    opacity: 0.5;
                    font-size: 10px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    -webkit-line-clamp: 2;
                  }
                }

                .price {
                  width: 25%;
                  text-align: right;
                  font-size: 14px;
                  color: #fff;
                }

                .num {
                  width: 25%;
                  text-align: right;
                  font-size: 14px;
                }

                .iconfont {
                  position: absolute;
                  bottom: 10px;
                  right: 0px;
                  color: #fff;
                  display: none;
                }
              }

              .stock_item:hover {
                .iconfont {
                  display: block;
                }
              }
            }

            .stock_item {
              width: 100%;
              padding: 10px 0;
              cursor: pointer;

              .item_top {
                width: 100%;
                margin-bottom: 10px;
                display: flex;
                align-items: center;
                justify-content: space-between;

                .item_top_left {
                  width: 100%;
                  display: flex;
                  align-items: center;

                  .img_logo {
                    width: 30px;
                    height: 30px;
                    border-radius: 50%;
                    margin-right: 10px;
                  }

                  .name {
                    font-weight: 700;
                    font-size: 15px;
                    color: #fff;
                  }

                  .type {
                    background-color: rgba(0, 123, 255, 0.1);
                    color: #007bff;
                    border-radius: 3px;
                    font-size: 10px;
                    padding: 2px 5px;
                    box-sizing: border-box;
                    border: none;
                    font-style: normal;
                    margin-left: 10px;
                  }
                }

                .top_right {
                  font-size: 14px;
                }
              }

              .item_bottom {
                .price {
                  font-size: 700;
                  font-size: 15px;
                  color: #fff;
                }

                .name {
                  font-size: 11px;
                  color: hsla(0, 0%, 100%, 0.7);
                }
              }
            }
          }
        }
      }
    }

    .icon-sousuo {
      font-size: 16px;
      color: #fff;
      cursor: pointer;
    }
  }

  .trad_content {
    min-width: 700px;
    overflow: hidden;
    flex: 1;
    margin: 0 5px;

    .content_top {
      width: 100%;
      height: 70%;
      padding: 10px 10px 0 10px;
      background-color: rgb(32, 43, 44);
      border-radius: 5px;
      overflow: hidden;

      .top_title {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .top_Left {
          display: flex;
          align-items: center;

          .icon-zuojiantou- {
            font-size: 22px;
            color: #fff;
            opacity: 0.7;
            margin-right: 10px;
            cursor: pointer;
          }

          .title_name {
            font-size: 16px;
            margin-right: 10px;
            font-weight: 700;
            color: #fff;
            cursor: pointer;
          }

          .title_type {
            font-size: 14px;
            color: #fff;
            opacity: 0.7;
            cursor: pointer;
          }
        }

        .iconfont {
          font-size: 22px;
          color: #fff;
          opacity: 0.7;
          cursor: pointer;
        }
      }

      .chart_type {
        width: 100%;
        display: flex;
        align-items: center;

        .type_left {
          display: flex;
          align-items: center;
          margin-right: 15px;
          padding: 8px 0;

          p {
            cursor: pointer;
            line-height: 20px;
            color: #666;
            font-size: 14px;
            padding: 0 5px;
          }

          .active {
            color: #1fb1ea;
            font-weight: 700;
          }
        }

        .icon-zhexiantu-xianxing {
          color: #666;
          font-size: 16px;
          font-weight: 700;
        }
      }

      .chart_line {
        width: 100%;
        height: 443px;
      }

      .bottom_type {
        display: flex;
        align-items: center;
        padding: 8px 0;

        .type_left:first-child {
          width: 40%;
        }

        .type_left {
          flex: 1;
          display: flex;
          align-items: center;

          p {
            padding: 0 5px;
            line-height: 20px;
            color: #666;
            font-size: 11px;
            cursor: pointer;
          }
        }
      }
    }

    .content_bottom {
      width: 100%;
      padding: 10px 10px 0 10px;
      margin-top: 5px;
      background-color: rgb(32, 43, 44);
      border-radius: 5px;
      height: 30%;

      .title {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .title_left {
          flex: 1;
          display: flex;
          align-items: center;

          .title_item {
            height: 43px;
            line-height: 43px;
            margin-right: 20px;
            cursor: pointer;
            position: relative;

            p {
              font-size: 14px;
              color: #fff;
              opacity: 0.6;
            }

            .underline {
              position: absolute;
              bottom: 0;
              left: 50%;
              width: 20px;
              height: 3px;
              background-color: transparent;
              transition: background-color 0.3s;
              transform: translateX(-50%);
              border-radius: 8px;
              opacity: 1;
            }

            .active {
              background-color: #f5bd08;
              /* 选中时下划线颜色 */
              border-radius: 8px;
            }
          }
        }

        .icon-xiajiantou- {
          color: #666;
          font-size: 16px;
          font-weight: 700;
        }
      }

      .order_list {
        height: 100%;
        flex: 1;
        height: calc(100% - 43px - 10px);
        overflow-y: auto;
        position: relative;

        .bottom_loading {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          /* 向上向左移动自身宽高的50% */
        }

        .order_item {
          width: 100%;
          padding: 10px;
          margin-bottom: 10px;

          .item_top {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;

            .top_left {
              display: flex;
              align-items: center;

              .order_type {
                background: none;
                color: #f35956;
                border: 1px solid #f35956;
                border-radius: 3px;
                font-size: 10px;
                padding: 2px 5px;
                box-sizing: border-box;
                margin-right: 10px;
                cursor: pointer;
              }

              .stock_name {
                font-weight: 700;
                margin-right: 10px;
                cursor: pointer;
                font-size: 15px;
                color: #fff;
              }

              .num {
                margin-right: 10px;
                cursor: pointer;
                font-size: 15px;
                color: #fff;
              }

              .stock_num {
                margin-right: 10px;
                cursor: pointer;
                font-size: 15px;
                color: #fff;
              }
            }

            .top_right {
              display: flex;
              align-items: center;

              .time {
                font-size: 12px;
                color: #fff;
                opacity: 0.7;
              }

              .btn1,
              .btn2 {
                cursor: pointer;
                border-radius: 5px;
                margin-left: 15px;
                font-size: 12px;
                padding: 3px 10px;
                background-color: #589cf8;
                color: #fff;
              }

              .btn2 {
                display: flex;
                align-items: center;

                .icon-__guanbi {
                  margin-right: 5px;
                }
              }
            }
          }

          .item_list {
            width: 100%;
            display: flex;
            align-items: center;
            padding-top: 10px;

            .title_name:first-child {
              .title_name {
                text-align: left;
              }

              .title_num {
                text-align: left;
              }
            }

            .item_text {
              width: 16.6%;
              display: flex;
              flex-direction: column;

              .title_name {
                font-size: 12px;
                color: #fff;
                opacity: 0.7;
                text-align: center;
              }

              .title_num {
                font-size: 14px;
                color: #fff;
                text-align: center;
              }

              .name1 {
                text-align: left;
              }

              .name2 {
                text-align: right;
              }
            }
          }
        }
      }
    }
  }

  .trad_right {
    width: 320px;
    background-color: #202b2c;
    border-radius: 5px;
    padding: 15px 0;

    .trad_info_top {
      width: 100%;
      padding: 0 15px;

      .trad_name {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .name {
          font-size: 16px;
          margin-bottom: 5px;
          font-weight: 700;
          color: #fff;
        }

        .icon-xihuan1 {
          font-size: 26px;
          color: #fff;
          opacity: 0.6;
        }
      }

      .num_text {
        width: 100%;

        .num {
          font-weight: 700;
          font-size: 30px;
          color: rgb(25, 202, 124);
        }

        .num_list {
          width: 100%;

          .num_item {
            width: 100%;
            display: flex;
            align-items: center;
            padding-bottom: 10px;

            .item_left {
              display: flex;
              align-items: center;

              .icon-xiajiang {
                font-size: 16px;
                color: rgb(25, 202, 124);
              }

              .num_text1 {
                font-size: 14px;
                color: rgb(25, 202, 124);
                font-weight: 700;
                margin-left: 5px;
              }
            }

            .num_text1 {
              font-size: 14px;
              color: rgb(25, 202, 124);
              font-weight: 700;
              margin-left: 5px;
            }

            .num_type {
              font-size: 12px;
              color: #fff;
              opacity: 0.7;
              margin-left: 5px;
            }

            .num_text2 {
              font-size: 14px;
              color: rgb(25, 202, 124);
              font-weight: 700;
              padding: 0 5px;
              margin-left: 5px;
            }
          }
        }
      }
    }

    .trad_list {
      width: 100%;
      height: calc(100vh - 240px);
      overflow: hidden;
      overflow-y: auto;

      .title_list {
        width: 100%;
        display: flex;
        align-items: center;
        padding: 0 15px;

        .title_item {
          position: relative;
          margin-right: 20px;
          cursor: pointer;

          .name {
            line-height: 43px;
            font-size: 14px;
            color: #fff;
            opacity: 0.7;
          }

          .underline {
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 20px;
            height: 3px;
            background-color: transparent;
            transition: background-color 0.3s;
            transform: translateX(-50%);
            border-radius: 8px;
          }

          .active {
            background-color: #f5bd08;
            /* 选中时下划线颜色 */
            border-radius: 8px;
          }

          .nameActive {
            color: rgb(88, 156, 248);
          }
        }
      }

      .change_content {
        width: 100%;
        padding: 0 15px;

        .content_list {
          width: 100%;
          display: flex;
          align-items: center;
          flex-direction: column;

          .list1:first-child {
            padding-top: 10px;
          }

          .list1 {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 10px;

            .list_item {
              width: 48%;
              display: flex;
              align-items: center;
              margin: 0;
              flex-direction: row;
              justify-content: space-between;

              .name {
                color: #fff;
                opacity: 0.7;
                font-size: 14px;
              }

              .value {
                color: rgb(187, 187, 187);
                font-size: 14px;
                margin-top: 0;
                // text-align:left;
              }
            }
          }
        }

        .see_more {
          width: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
          padding-bottom: 10px;
          border-bottom: 1px solid #3c3e47;

          .more_text,
          .icon-youjiantou {
            cursor: pointer;
            font-size: 12px;
            color: #589cf8;
          }

          .icon-youjiantou {
            font-size: 10px;
            margin-left: 5px;
          }
        }

        .stock_info {
          width: 100%;
          padding-top: 15px;
          border-bottom: 1px solid #3c3e47;

          .info_list {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 15px;
            cursor: pointer;

            .name {
              font-size: 14px;
              color: #fff;
              cursor: pointer;
            }

            .list_right {
              display: flex;
              align-items: center;
              justify-content: flex-end;

              .multiple {
                padding: 5px 10px;
                background-color: #555;
                border-radius: 3px;
                box-sizing: border-box;
                border: 1px solid #555;
                font-size: 15px;
                cursor: pointer;
                color: #fff;
                margin-left: 10px;
              }

              .btn1 {
                background-color: #27c77e;
                color: #fff;
                border-top-left-radius: 5px;
                border-bottom-left-radius: 5px;
                margin-right: 3px;
                padding: 5px 18px;
                font-size: 14px;
                cursor: pointer;
              }

              .btn2 {
                border-top-right-radius: 5px;
                border-bottom-right-radius: 5px;
                padding: 5px 18px;
                color: #ffffff99;
                background-color: #555;
                font-size: 14px;
                cursor: pointer;
              }
            }

            .type {
              .type_text1 {
                position: relative;
                cursor: pointer;

                p {
                  line-height: 30px;
                  font-size: 14px;
                  color: #bbb;
                }

                .underline {
                  position: absolute;
                  bottom: 0;
                  left: 50%;
                  width: 20px;
                  height: 3px;
                  background-color: transparent;
                  transition: background-color 0.3s;
                  transform: translateX(-50%);
                  border-radius: 8px;
                }

                .active {
                  background-color: #f5bd08;
                  /* 选中时下划线颜色 */
                  border-radius: 8px;
                }
              }

              .type_text1:last-child {
                margin-left: 15px;
              }
            }

            .input_text {
              width: 150px;

              input {
                width: 100%;
                border: 1px solid #3c3e47;
                border-radius: 5px;
                display: block;
                padding: 5px 10px;
                font-weight: 700;
                font-size: 14px;
                background-color: #202b2c;
                color: #fff;
              }
            }
          }
        }

        .info_big_list {
          width: 100%;
          display: flex;
          flex-direction: column;
          align-items: end;
          padding-bottom: 15px;

          .list_top {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 15px;

            .name {
              font-size: 14px;
              color: #fff;
            }

            .top_right {
              width: 150px;
              display: flex;
              align-items: center;
              justify-content: space-between;

              .remove {
                height: 25px;
                width: 30px;
                background-color: rgb(85, 85, 85);
                border-top-left-radius: 4px;
                border-bottom-left-radius: 4px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;

                .icon-jianhao {
                  font-size: 12px;
                  color: #fff;
                }
              }

              input {
                width: 70%;
                height: 25px;
                color: rgb(255, 255, 255);
                font-size: 11px;
                background: rgb(85, 85, 85);
                margin: 0 3px;
                text-align: center;
              }

              .add {
                height: 25px;
                width: 30px;
                background-color: rgb(85, 85, 85);
                border-top-right-radius: 4px;
                border-bottom-right-radius: 4px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;

                .icon-jiahao {
                  font-size: 12px;
                  color: #fff;
                }
              }
            }
          }

          .list_bottom {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-end;

            p {
              padding: 5px 10px;
              margin-left: 10px;
              cursor: pointer;
              background-color: #555;
              border-radius: 3px;
              border: 1px solid #555;
              font-size: 15px;
              color: #fff;
              cursor: pointer;
            }
          }
        }

        .text_info {
          border-bottom: none;
          padding-top: 15px;

          .info_list {
            padding-bottom: 5px;

            .list_right {
              color: #fff;
            }
          }
        }

        .type_btn {
          width: 100%;
          height: 38px;
          margin-top: 15px;
          font-size: 14px;
          margin-bottom: 10px;
          //   background-color: #27c77e;
          border-radius: 5px;
          padding: 2px 0;
          color: #fff;
          text-align: center;
          line-height: 38px;
          cursor: pointer;
        }

        .dynamic_charts {
          width: 100%;

          .title {
            width: 100%;
            display: flex;
            align-items: center;

            .title_item {
              height: 30px;
              margin-right: 20px;
              cursor: pointer;
              position: relative;

              .name {
                color: rgb(255, 255, 255, 0.6);
                font-size: 14px;
                line-height: 30px;
              }

              .underline {
                position: absolute;
                bottom: 0;
                left: 50%;
                width: 20px;
                height: 3px;
                background-color: transparent;
                transition: background-color 0.3s;
                transform: translateX(-50%);
                border-radius: 8px;
              }

              .active {
                background-color: #f5bd08;
                /* 选中时下划线颜色 */
                border-radius: 8px;
              }
            }
          }
        }

        .charts {
          width: 100%;
          display: flex;
          //   align-items: center;
          //   justify-content: center;
          padding-top: 10px;

          .charts_left {
            width: 50%;

            .title {
              font-size: 10px;
              opacity: 0.3;
              padding-bottom: 10px;
              color: #fff;
            }

            .left_list {
              width: 100%;

              .list_item {
                width: 100%;
                height: 40px;
                position: relative;
                display: flex;
                flex-direction: column;
                align-items: end;

                .Proportion {
                  height: 100%;
                  background-color: #19ca7c1a;
                }

                .left {
                  position: absolute;
                  left: 0;
                  top: 50%;
                  transform: translateY(-50%);
                  color: #fff;
                  opacity: 0.75;
                  font-size: 11px;
                }

                .right {
                  position: absolute;
                  right: 4px;
                  top: 50%;
                  transform: translateY(-50%);
                  color: rgb(25, 202, 124);
                  font-size: 11px;
                }
              }
            }
          }

          .charts_right {
            width: 50%;

            .right_list {
              width: 100%;
              display: flex;
              flex-direction: column;
              align-items: start;

              .list_item {
                width: 100%;
                height: 40px;
                position: relative;

                .Proportion {
                  height: 100%;
                  background-color: #fe554f1a;
                }

                .left {
                  position: absolute;
                  left: 4px;
                  top: 50%;
                  transform: translateY(-50%);
                  color: rgb(254, 85, 79);
                  font-size: 11px;
                }

                .right {
                  position: absolute;
                  right: 0;
                  top: 50%;
                  transform: translateY(-50%);
                  color: #fff;
                  opacity: 0.75;
                  font-size: 11px;
                }
              }
            }
          }
        }
      }

      .analyze {
        width: 100%;
        // margin-top: 24px;
        // padding: 0 10px 10px 10px;
        display: flex;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        // .analyze_title {
        //   display: flex;
        //   align-items: center;
        //   margin-bottom: 24px;
        //   color: #dbdbdb;
        //   cursor: pointer;
        //   font-size: 20px;
        // }
        // .type_list {
        //   width: 100%;
        //   display: flex;
        //   align-items: center;
        //   justify-content: space-between;
        //   .text1:first-child {
        //     margin-left: 0px;
        //   }
        //   .text1 {
        //     padding: 0 12px;
        //     line-height: 34px;
        //     margin-left: 8px;
        //     color: #dbdbdb;
        //     font-size: 16px;
        //   }
        //   .active {
        //     border-radius: 6px;
        //     background-color: #2e2e2e;
        //     color: #fff;
        //   }
        //   .more_content {
        //     position: relative;
        //     .more_text {
        //       display: flex;
        //       align-items: center;
        //       padding: 5px 9px;
        //       background-color: #2e2e2e;
        //       border-radius: 6px;
        //       cursor: pointer;
        //       p {
        //         color: #dbdbdb;
        //       }
        //       .icon-youjiantou {
        //         transform: rotate(90deg);
        //         font-size: 10px;
        //         margin-left: 5px;
        //         color: #dbdbdb;
        //       }
        //     }
        //     .more_list {
        //       width: 80px;
        //       position: absolute;
        //       top: 35px;
        //       left: -7px;
        //       // border:1px solid red;
        //       padding: 6px 0;
        //       background-color: #1f1f1f;
        //       z-index: 9;
        //       border-radius: 6px;
        //       li {
        //         display: flex;
        //         align-items: center;
        //         justify-content: center;
        //         font-size: 14px;
        //         padding: 10px 2px 8px 2px;

        //         a {
        //           display: inline-block;
        //           color: #c9c9c9;
        //         }
        //       }
        //       li:hover {
        //         background-color: #2e2e2e;
        //       }
        //     }
        //   }
        // }
        // .Gauge_chart {
        //   width: 100%;
        //   height: 200px;
        //   margin-top: 20px;
        // }
        .tradingview_content {
          width: 100%;
          height: 500px;
        }

        // .bottom_type {
        //   width: 100%;
        //   display: flex;
        //   align-items: center;
        //   justify-content: center;
        //   .type_item {
        //     display: flex;
        //     align-items: center;
        //     flex-direction: column;
        //     margin: 0 16px;
        //     .name {
        //       color: #dbdbdb;
        //       font-size: 14px;
        //       font-weight: 600;
        //       line-height: 18px;
        //     }
        //     .value1 {
        //       font-size: 18px;
        //       color: #f7525f;
        //     }
        //     .value2 {
        //       font-size: 18px;
        //       color: #707070;
        //     }
        //     .value3 {
        //       font-size: 18px;
        //       color: #2962ff;
        //     }
        //   }
        // }
      }

      .overview {
        width: 100%;
        // padding-top: 15px;
        padding: 15px 15px 0 15px;

        .overview_text {
          width: 100%;

          .text_list {
            width: 100%;
            display: flex;
            align-items: center;

            .name {
              color: #fff;
              opacity: 0.7;
              font-size: 14px;
            }

            .value {
              color: #fff;
              opacity: 0.9;
              font-size: 14px;
              margin-left: 5px;
            }
          }
        }

        .info_text {
          line-height: 1.4;
          opacity: 0.7;
          margin-top: 15px;
          font-size: 14px;
          color: #fff;
        }
      }
    }
  }
}
</style>
